home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD024b.dsk
/
DUNGEON OF ARBEGLA.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
12KB
|
432 lines
1 V = -16336
10 B$ = "<CTRL-G>"
100 HOME
110 PRINT " THE APPLE DUNGEON"
120 PRINT : PRINT " APPLE II"
130 PRINT : PRINT : PRINT : PRINT "A FANTASY GAME FOR THE PRE-ALGEBRA CLASS"
160 GOSUB 440
170 GOSUB 440
180 HOME : DIM A(9,9,2)
190 PRINT " YOU WILL BE TELEPORTED TO..."
200 PRINT
210 PRINT "THE ALGEBRA DUNGEON"
220 PRINT : PRINT
240 MA = 0:CA = 0:G = 1000:M1 = 1:K = 0:TR = 0
250 PRINT "ENTER YOUR CHARACTER'S NAME"
260 INPUT A$
270 GOSUB 440
280 PRINT : PRINT "YOU CARRY 1000 PIECES OF GOLD WITH YOU"
290 PRINT : GOSUB 440: PRINT A$;"...YOU ARE ON YOUR WAY"
300 GOSUB 440
310 GOSUB 480
320 HOME
330 PRINT "YOU HAVE ARRIVED AT...."
340 PRINT
350 PRINT "THE ALGEBRA DUNGEON...LEVEL 2"
360 PRINT
370 PRINT "YOU WILL ENCOUNTER MONSTERS AND"
380 PRINT "THIEVES, AND GOLD...BUT WATCH"
390 PRINT "YOUR STEP.........."
400 PRINT "TRAP DOORS CAN BE COSTLY...."
410 FOR AB = 1 TO 4540
420 NEXT AB
430 GOTO 1010
440 REM DELAY
450 FOR Z2 = 1 TO 908
460 NEXT Z2
470 RETURN
480 REM SET UP 2 LEVEL DUNGEON
490 FOR X = 1 TO 8
500 FOR Y = 1 TO 8
510 FOR Z = 1 TO 2
520 A(X,Y,Z) = INT( RND(1) *7 +1)
530 NEXT Z
540 NEXT Y
550 NEXT X
560 REM TRAP DOORS #8
570 H = INT( RND(1) *3 +1)
580 FOR A = 1 TO 2
590 FOR N = 1 TO H
600 X = INT( RND(1) *8 +1)
610 Y = INT( RND(1) *8 +1)
620 A(X,Y,A) = 8
630 NEXT N
640 NEXT A
650 REM STAIRWAYS #9
660 S = INT( RND(1) *4 +1) +2
670 FOR A = 1 TO 2
680 FOR N = 1 TO S
690 X = INT( RND(1) *8 +1)
700 Y = INT( RND(1) *8 +1)
710 A(X,Y,A) = 9
720 NEXT N
730 NEXT A
740 RETURN
750 REM STAIRWAY
760 L1 = L1 -1
770 PRINT "YOU WALK UP THE STAIRWAY"
780 GOSUB 440
790 PRINT "THE ENCHANTED KEY....OPENS THE LOCK"
800 GOSUB 440
810 IF L1 = 0 THEN 870
820 MA = 0:K = 0:K4 = INT( RND(1) *4 +1) +4
830 PRINT :CB = CA +K4
840 PRINT "YOU ARE AT.....LEVEL 1"
850 GOSUB 440: GOSUB 440: GOSUB 440: GOSUB 440
860 GOTO 1070
870 PRINT "YOU FOUND YOUR WAY ..."
880 PRINT "...OUT OF THE ALGEBRA DUNGEON"
890 PRINT
900 PRINT "YOU HAVE AQUIRED ";G;" PEICES OF GOLD"
910 GOSUB 930
920 GOTO 1910
930 GG = G +100: REM RATING
940 R = INT((GG *CA -7000 +1)/M1)
960 PRINT : PRINT "THE GAME RATING IS ";R
970 PRINT : IF G < = 0 THEN 4280
980 PRINT "YOU TOOK ";M1;" TURNS TO FIND THE WAY OUT,"
990 PRINT "AND ANSWERED ";CA;" QUESTIONS CORRECTLY"
1000 PRINT "OUT OF ";TR;" QUESTIONS ASKED.": RETURN
1010 REM SET UP 1ST MOVE
1020 C = INT( RND(1) *8 +1)
1030 D = INT( RND(1) *8 +1)
1040 A(C,D,2) = 1
1050 L1 = 2
1060 K4 = INT( RND(1) *4 +1) +4
1070 REM PLAYER MOVE ROUTINE
1080 HOME
1090 A = A(C,D,L1)
1100 ON A GOSUB 2220,2280,2340,2340,2390,2700,2750,2790,3070
1120 PRINT
1130 PRINT : IF G < = 0 THEN 1820
1140 PRINT A$;", WHAT IS YOUR ACTION OR MOVE?"
1160 PRINT : PRINT "(N)ORTH, (E)AST, (S)OUTH, (W)EST
1170 PRINT "(U)P, (M)AP, (G)OLD"
1180 INPUT M1$
1190 M1 = M1 +1: IF K = 0 AND M1 > = 140/L1 THEN 4190
1200 IF M1$ = "N" THEN 1290
1210 IF M1$ = "E" THEN 1340
1220 IF M1$ = "S" THEN 1390
1230 IF M1$ = "W" THEN 1440
1240 IF M1$ = "U" THEN 1490
1250 IF M1$ = "M" THEN 1610
1260 IF M1$ = "G" THEN 1670
1280 PRINT : GOTO 1120
1290 REM NORTH MOVEMENT
1300 IF A = 7 THEN 1710
1310 IF (D -1) = 0 THEN 1980
1320 D = D -1
1330 GOTO 1070
1340 REM EAST MOVE
1350 IF A = 6 THEN 1770
1360 IF (C +1) = 9 THEN 2030
1370 C = C +1
1380 GOTO 1070
1390 REM SOUTH MOVE
1400 IF A = 7 THEN 1710
1410 IF (D +1) = 9 THEN 2050
1420 D = D +1
1430 GOTO 1070
1440 REM WEST MOVE
1450 IF A = 6 THEN 1770
1460 IF (C -1) = 0 THEN 2070
1470 C = C -1
1480 GOTO 1070
1490 HOME : REM STAIRWAY UP
1500 IF A < >9 THEN 1580
1510 IF K = 1 THEN 750
1530 PRINT : PRINT "YOU CANNOT GO UP THE STAIRWAY"
1540 PRINT "YOU DON'T HAVE THE KEY"
1550 GOSUB 440
1570 PRINT : GOTO 1120
1580 PRINT "YOU ARE NOT AT A STAIRWAY"
1590 GOSUB 440
1600 GOTO 1120
1610 HOME : REM MAP
1620 IF MA = 1 THEN 2090
1630 PRINT "YOU DON'T HAVE THE MAP"
1650 PRINT : GOSUB 440
1660 GOTO 1120
1670 REM GOLD PIECES
1680 HOME : PRINT "YOU HAVE ";G;" PIECES OF GOLD WITH YOU"
1700 PRINT : GOTO 1120
1710 REM EW CORRIDOR
1720 PRINT
1730 HOME : PRINT "YOU ARE IN AN EAST-WEST CORRIDOR"
1740 PRINT "YOU CAN ONLY GO EAST OR WEST"
1750 PRINT
1760 GOTO 1120
1770 REM NS CORRIDOR
1780 PRINT
1790 HOME : PRINT "YOU ARE IN A NORTH-SOUTH CORRIDOR"
1800 PRINT "YOU CAN ONLY GO NORTH OR SOUTH"
1810 GOTO 1750
1820 REM GOLD ZERO
1830 GOSUB 440: GOSUB 440
1840 PRINT
1845 HOME : FOR I = 1 TO 10: PRINT B$: NEXT I
1850 PRINT "YOU LOST ALL YOUR GOLD AND YOU WERE"
1860 PRINT "...UNABLE TO MEET THE DEMANDS OF"
1870 PRINT "....THE ALGEBRA DUNGEON..."
1880 PRINT : PRINT
1890 PRINT "YOU CAN ONLY GO NORTH OR SOUTH"
1900 GOSUB 930
1910 PRINT
1920 PRINT "ANOTHER GAME?"
1930 PRINT "ENTER '1'-YES '0'-NO"
1940 INPUT AA
1950 IF AA < >1 THEN 1970
1960 HOME : GOTO 210
1970 PRINT CHR$(4)"RUN MENU"
1980 HOME : PRINT "YOU ARE AT THE NORTH WALL"
1990 PRINT "YOU CANNOT PASS THROUGH"
2000 PRINT
2010 PRINT "TRY ANOTHER DIRECTION?"
2020 GOTO 1120
2030 HOME : PRINT "YOU ARE AT THE EAST WALL"
2040 GOTO 1990
2050 HOME : PRINT "YOU ARE AT THE SOUTH WALL"
2060 GOTO 1990
2070 HOME : PRINT "YOU ARE AT THE WEST WALL"
2080 GOTO 1990
2090 REM DISPLAY MAP
2100 HOME
2110 PRINT
2130 FOR Q = 1 TO 8
2140 FOR N = 1 TO 8
2150 IF C = N AND D = Q THEN PRINT "P1 ";: GOTO 2180
2160 S1 = A(N,Q,L1)
2170 ON S1 GOSUB 3110,3110,3130,3130,3150,3170,3190,3210,3220
2180 NEXT N
2190 PRINT
2200 NEXT Q
2210 GOTO 1120
2220 REM EMPTY ROOM
2230 PRINT
2240 PRINT "YOU ARE IN A COLD AND DARK"
2250 PRINT ".............EMPTY CHAMBER"
2260 PRINT
2270 RETURN
2280 REM EMPTY ROOM 2
2290 PRINT
2300 PRINT "YOU ARE IN A DAMP AND MISTY"
2310 PRINT " EMPTY CHAMBER"
2320 PRINT
2330 RETURN
2340 TR = TR +1: HOME : GOSUB 4140
2350 M4 = INT( RND(1) *6 +1)
2360 ON M4 GOSUB 3240,3370,3540,3670,4360,4420
2370 PRINT
2380 RETURN
2390 HOME : FOR I = 1 TO 5: PRINT B$: NEXT I: PRINT "THERE IS A THIEF IN THIS CHAMBER"
2400 A(C,D,L1) = 2
2410 GOSUB 440
2420 G4 = INT( RND(1) *350/L1 +1)
2430 Y = INT( RND(1) *8 +1)
2440 IF Y < = 3 THEN 2610
2450 PRINT
2460 PRINT ".......HE SURPRISES YOU": PRINT
2470 GOSUB 440
2480 PRINT "AS HE QUICKLY PASSES BY YOU HE"
2490 PRINT "SNATCHES...";G4;" PIECES OF GOLD": PRINT
2500 G = G -G4
2510 REM LOOK FOR MAP
2520 IF MA = 1 THEN RETURN
2530 MA = INT( RND(1) *4 +1): IF MA < = 2 THEN MA = 1
2540 IF MA = 1 THEN 2570
2550 RETURN
2560 GOSUB 440
2570 PRINT "YOU SEARCH THE CHAMBER AND"
2580 GOSUB 440
2585 FOR I = 1 TO 5: PRINT B$: NEXT I
2590 PRINT "YOU.....FIND A MAP"
2600 RETURN
2610 PRINT "YOU SURPRISED THE THIEF...."
2620 PRINT : GOSUB 440
2630 PRINT "AS HE RUNS OUT HE DROPS...."
2640 PRINT "....";G4;" PIECES OF GOLD"
2650 PRINT "YOU PICK UP THE GOLD":G = G +G4
2660 PRINT : IF MA = 1 THEN RETURN
2670 MA = INT( RND(1) *4 +1): IF MA < = 2 THEN MA = 1
2680 IF MA = 1 THEN 2570
2690 RETURN
2700 HOME : REM NORTH SOUTH CORRIDOR
2710 PRINT
2720 PRINT "YOU ENTER A NORTH-SOUTH CORRIDOR"
2730 PRINT "THRU A SECRET DOOR": PRINT : GOSUB 4310
2740 RETURN
2750 HOME : REM EAST WEST CORRIDOR
2760 PRINT
2770 PRINT "YOU ENTER AN EAST-WEST CORRIDOR"
2780 GOTO 2730
2790 REM TRAP DOOR
2795 FOR I = 1 TO 5: PRINT B$: NEXT I
2800 PRINT "YOU ACTIVATED A ...TRAP DOOR"
2810 GOSUB 440
2820 TD = INT( RND(1) *4 +1)
2830 IF TD > = 3 THEN 2880
2840 PRINT
2850 PRINT "BUT...YOU CAUGHT YOURSELF"
2860 PRINT "FROM FALLING"
2870 RETURN
2880 IF L1 = 2 THEN 2990
2890 L1 = L1 +1: PRINT :K = 1
2900 PRINT "YOU FELL THRU TO LEVEL 2 ...AND"
2910 G = 100
2920 GOSUB 440
2930 PRINT
2940 PRINT "YOU..............LOST"
2950 PRINT "MOST OF YOUR GOLD": PRINT
2960 PRINT "YOU HAVE..";G;" PIECES OF GOLD LEFT"
2970 PRINT "BUT....YOU STILL HAVE YOUR KEY"
2980 RETURN
2990 PRINT "YOU FELL INTO A DEEP...PIT"
3000 GOSUB 440
3010 PRINT "YOU'RE LUCKY...."
3020 PRINT "YOU DIDN'T GET HURT"
3030 PRINT
3040 GOSUB 440
3050 PRINT "BUT IN CLIMBING OUT..."
3060 GOTO 4230
3070 PRINT "YOU ARE AT A STAIRWAY"
3080 PRINT "......GOING UP"
3090 PRINT
3100 RETURN
3110 PRINT "O ";
3120 RETURN
3130 PRINT "M ";
3140 RETURN
3150 PRINT "? ";
3160 RETURN
3170 PRINT "NS ";
3180 RETURN
3190 PRINT "EW ";
3200 RETURN
3210 GOTO 3150
3220 PRINT "UP ";
3230 RETURN
3240 REM Y=PX
3250 GOSUB 4330
3260 GOSUB 3800
3270 GOSUB 3840:Y = P *X
3280 PRINT "Y = ";P;"X"
3290 PRINT : PRINT "IF Y= ";Y;" THEN SOLVE FOR X"
3300 PRINT : INPUT A1
3310 IF A1 = X THEN 3350
3320 REM LOSE GOLD
3330 GOSUB 4000
3340 RETURN
3350 GOSUB 3900
3360 RETURN
3370 REM Y=PX-Q
3380 GOSUB 4330
3390 GOSUB 3800
3400 GOSUB 3840:Y = P *X
3410 PRINT "Y = ";P;"X - ";Q
3420 PRINT : PRINT "IF Y = ";Y -Q;" THEN SOLVE FOR X"
3430 PRINT : INPUT A1
3440 IF A1 = X THEN 3470
3450 GOSUB 4000
3460 RETURN
3470 GOSUB 3900
3480 RETURN
3490 GOSUB 480
3500 H = 1:O = 9:W = 8
3510 B = 0:E = 5:R = 14
3520 C = 0:PR = 0
3530 GOTO 1010
3540 REM Y=PX+Q
3550 GOSUB 4330
3560 GOSUB 3800
3570 GOSUB 3840:Y = P *X
3580 PRINT "Y = ";P;"X + ";Q
3590 PRINT : PRINT "IF Y = ";Y +Q;" THEN SOLVE FOR X"
3600 PRINT : INPUT A1
3610 IF A1 = X THEN 3650
3620 REM LOSE GOLD
3630 GOSUB 4000
3640 RETURN
3650 GOSUB 3900
3660 RETURN
3670 REM X=PY+Q
3680 GOSUB 4330
3690 GOSUB 3800
3700 GOSUB 3840:X = P *Y +Q
3710 PRINT "X = ";P;"Y + ";Q
3720 PRINT : PRINT "IF Y = ";Y;" THEN SOLVE FOR X"
3730 PRINT : INPUT A1
3740 IF A1 = X THEN 3780
3750 REM LOSE GOLD
3760 GOSUB 4000
3770 RETURN
3780 GOSUB 3900
3790 RETURN
3800 PRINT "YOU MAY NOT PASS THRU UNTIL"
3810 PRINT "YOU SOLVE THIS EQUATION FOR X"
3820 PRINT
3830 RETURN
3840 REM RANDOM ROUTINE
3850 X = INT( RND(1) *50/L1 +1):P = INT( RND(1) *50/L1 +1)
3860 Y = INT( RND(1) *50/L1 +1):Q = INT( RND(1) *50/L1 +1)
3870 GOSUB 440
3880 GOSUB 440
3890 RETURN
3900 PRINT "C<CTRL-G>O<CTRL-G>R<CTRL-G>R<CTRL-G>E<CTRL-G>C<CTRL-G>T<CTRL-G>"
3910 G4 = INT( RND(1) *400/L1 +1) +25
3920 G = G +G4
3930 GOSUB 440
3940 PRINT "YOU WIN ";G4;" PIECES OF GOLD"
3950 A(C,D,L1) = 1
3960 CA = CA +1: IF K = 1 THEN RETURN
3970 IF L1 = 1 THEN 4210
3980 IF CA = K4 THEN 4090
3990 RETURN
4000 PRINT
4002 FOR I = 1 TO 225:Q = PEEK(V) + PEEK(V): NEXT I
4010 PRINT "INCORRECT"
4020 PRINT "THE CORRECT ANSWER IS ";X
4030 PRINT
4040 G4 = INT( RND(1) *350/L1 +1)
4050 G = G -G4
4060 GOSUB 440
4070 PRINT "YOU LOSE ";G4;" PIECES OF GOLD"
4080 RETURN
4090 GOSUB 440
4100 K = 1
4110 PRINT : FOR I = 1 TO 5: PRINT B$: NEXT I: PRINT "YOU HAVE FOUND THE ENCHANTED KEY..."
4120 GOSUB 440
4130 RETURN
4140 PRINT "YOU DISTURBED A MONSTER IN THIS CHAMBER"
4150 GOSUB 440
4160 PRINT "AND HE SPEAKS.............": PRINT
4170 GOSUB 440
4180 RETURN
4190 GOSUB 4100
4200 GOTO 1200
4210 IF CA = CB THEN 4090
4220 RETURN
4230 G = 100: GOSUB 440: PRINT
4240 PRINT "YOU..........DROPPED"
4250 PRINT "MOST OF YOUR GOLD."
4260 PRINT "YOU HAVE...";G;" PIECES OF GOLD LEFT"
4270 RETURN
4280 PRINT "YOU ANSWERED ";CA;" QUESTIONS CORRECTLY"
4290 PRINT "OUT OF ";TR;" QUESTIONS ASKED,": PRINT ".....IN ";M1;" TURNS."
4300 RETURN
4310 PRINT "THE DOOR CLOSES AND LOCKS BEHIND YOU": GOSUB 440
4320 RETURN
4330 PRINT "HALT...I AM THE KEEPER"
4340 PRINT "OF.............ALGEBRA"
4350 PRINT : RETURN
4360 REM X=PY
4370 GOSUB 4330
4380 GOSUB 3800
4390 GOSUB 3840:X = P *Y
4400 PRINT "X = ";P;"Y"
4410 GOTO 3720
4420 REM X=PY-Q
4430 GOSUB 4330
4440 GOSUB 3800
4450 GOSUB 3840:X = P *Y -Q
4460 PRINT "X = ";P;"Y - ";Q
4470 GOTO 3720